package han.proof;

import han.gui.PopupBox;

import javax.swing.*;

/**
 * @author: Han
 * @date: 2018/7/3 14:14
 * @dscription: 二维码弹出界面
 */
public class QrPopupBox implements Runnable {
    private Icon icon;
    private PopupBox popupBox;
    private String title;

    QrPopupBox(Icon icon, String title) {
        this.icon = icon;
        this.title = title;
    }

    @Override
    public void run() {
        popupBox = new PopupBox(icon, title);
        popupBox.setVisible(true);
    }

    public void refresh(Icon icon){
        popupBox.setIcon(icon);
    }

    /**
     * 关闭弹窗
     */
    void dispose() {
        popupBox.dispose();
    }
}
